<template>
  <div>
    <el-container id="container">
      <el-header id="head">
        <img
          src="https://common-image-online.oss-cn-hangzhou.aliyuncs.com/milan.png"
          height="35px"
        />
        <span>&nbsp;tlias 智能学习辅助系统</span>
      </el-header>
      <el-container>
        <el-aside id="aside" width="220px">
          <el-menu
            class="el-menu-vertical-demo"
            @open="handleOpen"
            @close="handleClose"
            background-color="#545c64"
            text-color="#fff"
            active-text-color="#ffd04b"
          >
            <el-submenu index="1">
              <template slot="title">
                <i class="el-icon-location"></i>
                <span>系统信息管理</span>
              </template>
              <el-menu-item index="1-1">
                <router-link to="/main/dept" class="menu-class"
                  >部门管理</router-link
                >
              </el-menu-item>
              <el-menu-item index="1-2">
                <router-link to="/main/emp" class="menu-class">员工管理</router-link>
              </el-menu-item>
            </el-submenu>
          </el-menu>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import axios from "axios";

export default {
  data() {
    return {
      tableData: [],
      form: {
        user: "",
        region: "",
        daterange: "",
      },
    };
  },
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
  },
  mounted() {
    axios
      .get("https://mock.apifox.cn/m1/3128855-0-default/emp/list")
      .then((result) => {
        this.tableData = result.data.data;
      });
  },
};
</script>

<style>
#container {
  border: 1px solid #eee;
}

#head {
  font-size: 40px;
  color: white;
  background-color: #409EFF;
}

#aside {
  height: 650px;
  border: 1px solid #eee;
  background-color: #545c64;
}

.menu-class {
  text-decoration: none;
  color: white;
}
</style>